#ifndef CDATAITEM_H
#define CDATAITEM_H
#include <QVector>
#include <QString>

struct DATA_ITEM
{
    QString sSrc;
    QString sExplain;
    QString sURL;

    DATA_ITEM()
    {
        sSrc = "";
        sExplain = "";
        sURL = "";
    }
};

class CDataItem
{
public:
    CDataItem();

    int Load(QString &sFile);

    int Save(QString &sFile);

    void AddItem(DATA_ITEM &item)
    {
        m_vctData.append(item);
    }

    void DelItem(int nIndex)
    {
        m_vctData.remove(nIndex);
    }

    void GetItem(int nIndex, DATA_ITEM &item);
    int GetCount()
    {
        return m_vctData.size();
    }

private:
    QVector<DATA_ITEM> m_vctData;
};

#endif // CDATAITEM_H
